package com.yu.common.handler;

import cn.hutool.db.meta.JdbcType;
import com.mysql.cj.xdevapi.PreparableStatement;

import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public interface TypeHandler<T> {
    //保存操作，数据入库之前时数据处理
    void setParameter(PreparedStatement statement, int i, T parameter, JdbcType jdbcType) throws SQLException;

    T getResult(ResultSet resultSet, String columenName) throws SQLException;

    T getResult(ResultSet resultSet, int columnIndec) throws SQLException;

    T getResult(CallableStatement callableStatement, int columnIndec) throws SQLException;
}
